package cn.flying.cloud.system.model;

import java.io.Serializable;
import java.util.Objects;
import java.util.Set;

/**
 * 组织领域模型
 *
 * @author: admin
 * @date: 2023年06月12日 19:07
 * @version: 1.0
 */
public class Organization implements Serializable {
    /**
     * 主键ID
     */
    private Long id;

    /**
     * 组织编码
     */
    private String orgId;

    /**
     * 组织名称
     */
    private String orgName;

    /**
     * 上级组织编码
     */
    private String parentId;

    /**
     * 上级组织名称
     */
    private String parentName;

    /**
     * 组织层级
     */
    private String orgLevel;

    /**
     * 组织类型
     */
    private String orgType;

    /**
     * 机构路径
     */
    private String orgPath;

    /**
     * 办公电话
     */
    private String phone;

    /**
     * 地址
     */
    private String orgAddress;

    /**
     * 扩展字段1
     */
    private String ext1;

    /**
     * 扩展字段2
     */
    private String ext2;

    /**
     * 扩展字段3
     */
    private String ext3;

    /**
     * 备注
     */
    private String remark;

    /**
     * 租户ID
     */
    private String tenantId;

    /**
     * 所属用户
     */
    private Set<User> users;

    private static final long serialVersionUID = 1L;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId == null ? null : orgId.trim();
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName == null ? null : orgName.trim();
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId == null ? null : parentId.trim();
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName == null ? null : parentName.trim();
    }

    public String getOrgLevel() {
        return orgLevel;
    }

    public void setOrgLevel(String orgLevel) {
        this.orgLevel = orgLevel == null ? null : orgLevel.trim();
    }

    public String getOrgType() {
        return orgType;
    }

    public void setOrgType(String orgType) {
        this.orgType = orgType == null ? null : orgType.trim();
    }

    public String getOrgPath() {
        return orgPath;
    }

    public void setOrgPath(String orgPath) {
        this.orgPath = orgPath == null ? null : orgPath.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public String getOrgAddress() {
        return orgAddress;
    }

    public void setOrgAddress(String orgAddress) {
        this.orgAddress = orgAddress == null ? null : orgAddress.trim();
    }

    public String getExt1() {
        return ext1;
    }

    public void setExt1(String ext1) {
        this.ext1 = ext1 == null ? null : ext1.trim();
    }

    public String getExt2() {
        return ext2;
    }

    public void setExt2(String ext2) {
        this.ext2 = ext2 == null ? null : ext2.trim();
    }

    public String getExt3() {
        return ext3;
    }

    public void setExt3(String ext3) {
        this.ext3 = ext3 == null ? null : ext3.trim();
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId == null ? null : tenantId.trim();
    }

    public Set<User> getUsers() {
        return users;
    }

    public void setUsers(Set<User> users) {
        this.users = users;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", orgId=").append(orgId);
        sb.append(", orgName=").append(orgName);
        sb.append(", parentId=").append(parentId);
        sb.append(", parentName=").append(parentName);
        sb.append(", orgLevel=").append(orgLevel);
        sb.append(", orgType=").append(orgType);
        sb.append(", orgPath=").append(orgPath);
        sb.append(", phone=").append(phone);
        sb.append(", orgAddress=").append(orgAddress);
        sb.append(", ext1=").append(ext1);
        sb.append(", ext2=").append(ext2);
        sb.append(", ext3=").append(ext3);
        sb.append(", remark=").append(remark);
        sb.append(", tenantId=").append(tenantId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Organization that = (Organization) o;
        return Objects.equals(id, that.id) && Objects.equals(orgId, that.orgId) && Objects.equals(orgName, that.orgName) && Objects.equals(parentId, that.parentId) && Objects.equals(parentName, that.parentName) && Objects.equals(orgLevel, that.orgLevel) && Objects.equals(orgType, that.orgType) && Objects.equals(orgPath, that.orgPath) && Objects.equals(phone, that.phone) && Objects.equals(orgAddress, that.orgAddress) && Objects.equals(ext1, that.ext1) && Objects.equals(ext2, that.ext2) && Objects.equals(ext3, that.ext3) && Objects.equals(remark, that.remark) && Objects.equals(tenantId, that.tenantId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, orgId, orgName, parentId, parentName, orgLevel, orgType, orgPath, phone, orgAddress, ext1, ext2, ext3, remark, tenantId);
    }
}